package com.leetcode.problems94;


import com.leetcode.util.TreeNode;

import java.util.ArrayList;
import java.util.List;

/**
 * https://leetcode-cn.com/problems/binary-tree-inorder-traversal/submissions/
 * @Date 2021/11/20 14:34
 * @Author ghery
 * @Version V1.0
 */
public class Solution {


    public List<Integer> inorderTraversal(TreeNode root) {

        List<Integer> ans = new ArrayList<>();
        inorderTraversal(root,ans);
        return ans;
    }

    public void inorderTraversal(TreeNode root, List<Integer> ans) {
        if(root == null){
            return;
        }
        inorderTraversal(root.left,ans);
        ans.add(root.val);
        inorderTraversal(root.right,ans);
    }
    public static void main(String[] args) {
        System.out.println();
    }
}
